home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / STRINGS / DYNAMIC.PAS next >
Pascal/Delphi Source File  |  1996-08-08  |  921b  |  29 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; dynamic string handling
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBINI, EFLIBTXT;
  10.  
  11.  
  12. var SomeString : StringObjectType;
  13.  
  14. begin
  15.      with SomeString do begin
  16.           { Initialize a dynamic text string }
  17.           Initialize ('Dynamically allocated text string');
  18.  
  19.           { Display stored text }
  20.           WriteLn  (Text, ' (', Succ(Length), ' bytes).');
  21.  
  22.           { Reallocate with another string }
  23.           Update ('Smaller allocation');
  24.           WriteLn  (Text, ' (', Succ(Length), ' bytes).');
  25.  
  26.           { Intercept object (dispose allocated string) }
  27.           Intercept;
  28.      end;
  29. end.